import request from '@/utils/request'

// 查询规格属性列表
export function listAttr(query) {
  return request({
    url: '/goods/attrValues/list',
    method: 'get',
    params: query
  })
}

// 查询规格属性详细
export function getAttr(id) {
  return request({
    url: '/goods/attrValues/' + id,
    method: 'get'
  })
}

// 新增规格属性
export function addAttr(data) {
  return request({
    url: '/goods/goodsAttrValues/add',
    method: 'post',
    data: data
  })
}

// 修改规格属性
export function updateAttr(data) {
  return request({
    url: '/goods/attrValues/edit',
    method: 'put',
    data: data
  })
}

// 删除规格属性
export function delAttr(id) {
  return request({
    url: '/goods/goodsAttrValues/' + id,
    method: 'delete'
  })
}

export function getAttrAll(query) {
  return request({
    url: '/goods/attr/all',
    method: 'get',
    params: query
  })
}

export function getAttrValues(query) {
  return request({
    url: '/goods/attrValues/getAttrValues',
    method: 'get',
    params: query
  })
}
